import AMap from "AMap";

export function distance(p1,p2){
    var dis = AMap.GeometryUtil.distance(p1, p2);
    if(parseInt(dis/1000)==0){
        return `${dis}m`
    }else{
        return `${(dis/1000).toFixed(2)}km`
    }
}